home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d8 / pdriver5.arc / PACKET_D.108 < prev    next >
Text File  |  1989-12-17  |  28KB  |  1,189 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.       PC/TCP Version 1.08 Packet Driver Specification         1
  7.       FTP Software, Inc.
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.                PC/TCP Packet Driver Specification
  15.  
  16.  
  17.       Revision 1.08
  18.       December-12-1988
  19.       Developed by:
  20.  
  21.       FTP Software, Inc.
  22.       P.O. Box 150
  23.       Kendall Sq. Branch
  24.       Boston, MA  02142
  25.       (617) 868-4878
  26.  
  27.  
  28.       Note: this  document is public domain and may be distributed
  29.       freely and without fee or  permission.  FTP  Software's name
  30.       and  this notice must appear on  any    reproduction  of  this
  31.       document.
  32.  
  33.       Support of  a hardware interface, or mention of an interface
  34.       manufacturer, by the Packet  Driver  specification  does not
  35.       necessarily indicate    that  the  manufacturer  endorses this
  36.       specification.
  37.  
  38.  
  39.       1  Introduction and Motivation
  40.  
  41.  
  42.       This document describes  the programming interface to PC/TCP
  43.       packet  drivers.  Packet drivers provide  a  simple,    common
  44.       programming  interface that allows multiple applications  to
  45.       share a network interface at the data link level. The packet
  46.       drivers   demultiplex   incoming    packets     amongst   the
  47.       applications by using the network media type field.
  48.  
  49.       Different  versions  of  PC/TCP  exist for different network
  50.       media (Ethernet, 802.5 ring, serial lines), but  through the
  51.       use of the packet  driver,  the actual brand or model of the
  52.       network interface can be hidden from the application.
  53.  
  54.       The packet driver provides calls  to    initiate  access  to a
  55.       specific packet type, to end access to it, to send a packet,
  56.       to  get  statistics  on  the    network interface and  to  get
  57.       information about the interface.
  58.  
  59.       Protocol  implementations  that use the  packet  driver  can
  60.       completely coexist on a PC and can make use of one another's
  61.       services, whereas multiple applications which do not use the
  62.       driver do not  coexist  on one machine properly. Through use
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.       2           PC/TCP Version 1.08 Packet Driver Specification
  73.                             FTP Software, Inc.
  74.  
  75.  
  76.       of the packet driver, a user could run TCP/IP, DECnet, and a
  77.       proprietary  protocol  implementation   such     as  Banyan's,
  78.       LifeNet's,  Novell's    or  3COM's  without  the  difficulties
  79.       associated with preempting the network interface.
  80.  
  81.       Applications which use the packet driver can also run on new
  82.       network hardware of the same class  without  being modified;
  83.       only a new packet driver need be supplied.
  84.  
  85.       Two  levels  of  packet  drivers  are   described   in  this
  86.       specification. The first is the basic  packet  driver, which
  87.       provides minimal  functionality  but    should    be  simple  to
  88.       implement and  which uses very few host resources. The basic
  89.       driver provides operations to broadcast and receive packets.
  90.       The second driver is the  extended packet driver, which is a
  91.       superset of the basic driver. The  extended  driver supports
  92.       less commonly used functions of the  network    interface such
  93.       as  multicast, and also gathers statistics  on  use  of  the
  94.       interface and makes these available to the application.
  95.  
  96.       Functions which are available in  only  the  extended packet
  97.       driver are noted as  such  in  their descriptions. All basic
  98.       packet  driver  functions  are  available  in  the  extended
  99.       driver.
  100.  
  101.  
  102.       2  Identifying network interfaces
  103.  
  104.  
  105.       Network interfaces  are  named  by  a  triplet  of integers,
  106.       <class, type, number>.  The first is the class of interface.
  107.       The class tells what    kind  of  media  the interface is for:
  108.       DEC/Intel/Xerox/Ethernet,   IEEE   802.3    Ethernet,   IEEE
  109.       802.5/Token Ring, ProNET-10, Broadband Ethernet,  Appletalk,
  110.       serial line, etc.
  111.  
  112.       The second number is the type of interface: this specifies a
  113.       particular instance of an interface  supporting  a  class of
  114.       medium.  Interface  types  for  Ethernet  might  name  these
  115.       interfaces: 3COM 3C501 or 3C505, Interlan NI5010, Univation,
  116.       BICC     Data    Networks   ISOLAN,  Ungermann-Bass  NIC,  etc.
  117.       Interface types for IEEE 802.5 might name  these interfaces:
  118.       IBM Token Ring adapter, Proteon p1340, etc.
  119.  
  120.       The last number is  the  interface  number.  If a machine is
  121.       equipped with more than one interface of a  class  and type,
  122.       the interfaces must be numbered to distinguish between them.
  123.  
  124.       An appendix details constants  for  classes  and  types. The
  125.       class of an interface is an 8-bit integer, and its type is a
  126.       16 bit integer. Class and  type constants are managed by FTP
  127.       Software.  Contact  FTP  to  register  a new class  or  type
  128.       number.
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.       PC/TCP Version 1.08 Packet Driver Specification         3
  139.       FTP Software, Inc.
  140.  
  141.  
  142.       The  type  0xFFFF  is  a  wildcard  type  which matches  any
  143.       interface in    the  specified    class.    It  is    unnecessary to
  144.       wildcard interface numbers, as 0 will  always  correspond to
  145.       the first interface of the specified class and type.
  146.  
  147.       This specification  has  no  provision  for  the  support of
  148.       multiple  network  interfaces  (with    similar  or  different
  149.       characteristics)  via a single Packet Driver and  associated
  150.       interrupt.  We feel  that  this  issue  is best addressed by
  151.       loading  several  Packet Drivers, one  per  interface,  with
  152.       different interrupts (although  all  may  be    included  in a
  153.       single  TSR  software  module).   Applications software must
  154.       check the  class and type returned from a driver_info() call
  155.       already,  to make sure that the Packet  Driver  is  for  the
  156.       correct  media  and  packet  format.      This    can easily  be
  157.       generalized by searching for another    Packet    Driver    if the
  158.       first is not of the right kind.
  159.  
  160.  
  161.       3  Initiating driver operations
  162.  
  163.  
  164.       The packet driver is invoked via a software interrupt in the
  165.       range 0x60 through 0x80.  This  document  does not specify a
  166.       particular interrupt, but describes a mechanism for locating
  167.       which interrupt  the    driver    uses.  The  interrupt  must be
  168.       configurable    to  avoid   conflicts  with  other  pieces  of
  169.       software  that  also use software  interrupts.  The  program
  170.       which  installs  the     packet  driver  should  provide  some
  171.       mechanism for the user to specify the interrupt.
  172.  
  173.       The handler for the  interrupt  is  assumed  to start with 3
  174.       bytes of exectuable code; this can either be    a  3-byte jump
  175.       instruction,    or a 2-byte jump followed by  a  NOP  (do  not
  176.       specify "jmp short"  unless  you  also  specify  an explicit
  177.       NOP). This must be  followed    by  the  null-terminated ASCII
  178.       text string "PKT DRVR". To  find the interrupt being used by
  179.       the driver, an application should scan through  the handlers
  180.       for  vectors    0x60  through 0x80 until it finds one with the
  181.       text string "PKT DRVR" in it.
  182.  
  183.  
  184.       4  Programming interface
  185.  
  186.  
  187.       All  functions  are  accessed  via  the  software  interrupt
  188.       determined to be the driver's  via  the  mechanism described
  189.       earlier.  On entry, register AH contains  the  code  of  the
  190.       function desired.
  191.  
  192.       The handle is an  arbitrary  integer    value  associated with
  193.       each MAC-level demultiplexing type that has been established
  194.       via the access_type call. Internally to  the    packet driver,
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.       4           PC/TCP Version 1.08 Packet Driver Specification
  205.                             FTP Software, Inc.
  206.  
  207.  
  208.       it will  probably  be  a  pointer,  or  a table offset.  The
  209.       application calling the packet driver  cannot  depend  on it
  210.       assuming any particular range, or any other characteristics.
  211.  
  212.       Note that some  of  the functions defined below are labelled
  213.       as  extended    driver    functions.    Because  these  are  not
  214.       required for basic network operations,  their implementation
  215.       may be considered  optional.     Programs wishing to use these
  216.       functions should use the driver_info() function to determine
  217.       if they are available in a given packet driver.
  218.  
  219.  
  220.  
  221.       4.1  Entry conditions
  222.  
  223.       FTP Software applications which call the  packet  driver are
  224.       coded in Microsoft  C  and assembly language.  All necessary
  225.       registers  are  saved  by  FTP's  routines  before  the  INT
  226.       instruction to  call    the  packet  driver  is  executed. Our
  227.       current receiver() functions behave as follows:  DS  and the
  228.       flags  are  saved  and restored.  All other registers may be
  229.       modified,  and  should  be saved by the  packet  driver,  if
  230.       necessary. Processor interrupts may be enabled while    in the
  231.       upcall,  but    the   upcall  doesn't  assume  interrupts  are
  232.       disabled on entry.  On entry, receiver() switches to a local
  233.       stack.  Current FTP Software receiver() routines  may modify
  234.       all registers except DS, so the caller must save and restore
  235.       any that must be preserved across the call.
  236.  
  237.       Note    that  some  older  versions  of   PC/TCP   may    enable
  238.       interrupts during the  upcall,  and  leave  them  enabled on
  239.       return to the Packet Driver.
  240.  
  241.  
  242.       4.2  Byte ordering
  243.  
  244.       Developers should note that, on many    networks  and protocol
  245.       families,  the  byte-ordering of 16-bit  quantities  on  the
  246.       network  is opposite to the native  byte-order  of  the  PC.
  247.       (802.5  Token  Ring  is an exception).  This means that DEC-
  248.       Intel-Xerox ethertype values passed to access_type() must be
  249.       swapped (passed in network order).    The  IEE  802.3 length
  250.       field needs  similar handling, and care should be taken with
  251.       packets  passed to send_pkt(), so they  are  in  the    proper
  252.       order.
  253.  
  254.  
  255.       4.3  driver_info()
  256.  
  257.           driver_info(handle)      AH == 1 AL == FF
  258.               int      handle; BX          /* Optional */
  259.  
  260.       error return:
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.       PC/TCP Version 1.08 Packet Driver Specification         5
  271.       FTP Software, Inc.
  272.  
  273.  
  274.           carry flag set
  275.           error code          DH
  276.           possible errors:
  277.               BAD_HANDLE              /* older drivers only
  278.       */
  279.  
  280.       non-error return:
  281.           carry flag clear
  282.           version          BX
  283.           class                   CH
  284.           type              DX
  285.           number          CL
  286.           name              DS:SI
  287.           basic/extended      AL
  288.                       1 == basic, 2 == extended, FF == not
  289.       installed
  290.  
  291.       This function returns information about the interface.   The
  292.       version  is  assumed    to  be    an  internal  hardware    driver
  293.       identifier.  In earlier  versions  of  this spec, the handle
  294.       argument  (which must have been obtained via    access_type())
  295.       was required.  It is    now  optional,    but  drivers developed
  296.       according  to versions of this spec  previous  to  1.07  may
  297.       require it, so implementers should take care.
  298.  
  299.  
  300.       4.4  access_type()
  301.  
  302.           int access_type(if_class, if_type, if_number, type, typelen,
  303.       receiver) AH == 2
  304.               int      if_class;          AL
  305.               int      if_type;          BX
  306.               int      if_number;          DL
  307.               char far *type;          DS:SI
  308.               unsigned typelen;          CX
  309.               int      (far *receiver)();      ES:DI
  310.  
  311.       error return:
  312.           carry flag set
  313.           error code              DH
  314.           possible errors:
  315.               NO_CLASS
  316.               NO_TYPE
  317.               NO_NUMBER
  318.               BAD_TYPE
  319.               NO_SPACE
  320.               TYPE_INUSE
  321.  
  322.       non-error return:
  323.           carry flag clear
  324.           handle              AX
  325.  
  326.       receiver call:
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.       6           PC/TCP Version 1.08 Packet Driver Specification
  337.                             FTP Software, Inc.
  338.  
  339.  
  340.           (*receiver)(handle, flag, len [, buffer])
  341.               int      handle;      BX
  342.               int      flag;           AX
  343.               unsigned len;           CX
  344.           if AX == 1,
  345.               char far *buffer;      DS:SI
  346.  
  347.       Initiates access  to    packets  of  the  specified  type. The
  348.       argument type is  a  pointer to a packet type specification.
  349.       The  argument typelen is the length in  bytes  of  the  type
  350.       field. The argument receiver    is  a  pointer to a subroutine
  351.       which is called when    a  packet is received.    If the typelen
  352.       argument is 0, this indicates that the caller wants to match
  353.       all packets (match all requests  may    be  refused  by packet
  354.       drivers  developed  to  conform  to  versions  of  this spec
  355.       previous to 1.07).
  356.  
  357.       When a packet is received, receiver is called  twice    by the
  358.       packet driver. The first  time  is to request a buffer  from
  359.       the  application  to    copy the packet into.  AX == 0 on this
  360.       call. The  application should return a pointer to the buffer
  361.       in ES:DI. If the application has no buffers,    it  may return
  362.       0:0  in  ES:DI,  and the driver should throw away the packet
  363.       and not perform the second call.
  364.  
  365.       It is important that the packet length (CX) be valid    on the
  366.       AX == 0 call, so that the receiver can allocate a  buffer of
  367.       the proper size.  This length (as well as the copy performed
  368.       prior to the AX == 1 call) must include the  Ethernet header
  369.       and all received data, but not the trailing checksum.
  370.  
  371.       On the second call, AX == 1. This call  indicates  that  the
  372.       copy has been completed,    and the application may do as it
  373.       wishes  with    the  buffer. The buffer that  the  packet  was
  374.       copied into is pointed to by DS:SI.
  375.  
  376.  
  377.       4.5  release_type()
  378.  
  379.           int release_type(handle)      AH == 3
  380.               int      handle;      BX
  381.  
  382.       error return:
  383.           carry flag set
  384.           error code              DH
  385.           possible errors:
  386.               BAD_HANDLE
  387.  
  388.       non-error return:
  389.           carry flag clear
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.       PC/TCP Version 1.08 Packet Driver Specification         7
  403.       FTP Software, Inc.
  404.  
  405.  
  406.       This function  ends  access  to  packets  associated    with a
  407.       handle returned by  access_type().   The handle is no longer
  408.       valid.
  409.  
  410.  
  411.       4.6  send_pkt()
  412.  
  413.           int send_pkt(buffer, length)      AH == 4
  414.               char far *buffer;      DS:SI
  415.               unsigned length;      CX
  416.  
  417.       error return:
  418.           carry flag set
  419.           error code              DH
  420.           possible errors:
  421.               CANT_SEND
  422.  
  423.       non-error return:
  424.           carry flag clear
  425.  
  426.       Transmits length bytes  of  data,  starting  at  buffer. The
  427.       application  must supply the entire packet, including  local
  428.       network  headers.  Any  MAC or LLC information  in  use  for
  429.       packet demultiplexing (e.g.  the  DEC-Intel-Xerox Ethertype)
  430.       must be filled in  by  the application as well.  This cannot
  431.       be performed by the  driver,    as no handle is specified in a
  432.       call to the send_packet() function.
  433.  
  434.  
  435.       4.7  terminate()
  436.  
  437.           terminate(handle)          AH == 5
  438.               int      handle;      BX
  439.  
  440.       error return:
  441.           carry flag set
  442.           error code              DH
  443.           possible errors:
  444.               BAD_HANDLE
  445.               CANT_TERMINATE
  446.  
  447.       non-error return:
  448.           carry flag clear
  449.  
  450.       Terminates  the driver associated with handle. If  possible,
  451.       the driver will exit and  allow MS-DOS to reclaim the memory
  452.       it was using.
  453.  
  454.  
  455.       4.8  get_address()
  456.  
  457.           get_address(handle, buf, len)   AH == 6
  458.               int      handle;      BX
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.       8           PC/TCP Version 1.08 Packet Driver Specification
  469.                             FTP Software, Inc.
  470.  
  471.  
  472.               char far *buf;      ES:DI
  473.               int      len;          CX
  474.  
  475.       error return:
  476.           carry flag set
  477.           error code              DH
  478.           possible errors:
  479.               BAD_HANDLE
  480.               NO_SPACE
  481.  
  482.       non-error return:
  483.           carry flag clear
  484.           length          CX
  485.  
  486.       Copies the local net    address  associated  with  handle into
  487.       buf. The buffer buf is len bytes long. The actual  number of
  488.       bytes copied is returned in CX.  If the  NO_SPACE  error  is
  489.       returned, this indicates that len was  insufficient  to hold
  490.       the local net address.
  491.  
  492.  
  493.       4.9  reset_interface()
  494.  
  495.           reset_interface(handle)      AH == 7
  496.               int      handle;      BX
  497.  
  498.       error return:
  499.           carry flag set
  500.           error code              DH
  501.           possible errors:
  502.               BAD_HANDLE
  503.  
  504.       non-error return:
  505.           carry flag clear
  506.  
  507.       Resets the  interface  associated  with  handle  to  a known
  508.       state, aborting any  transmits in process and reinitializing
  509.       the receiver.  This call  has  been  included  primarily for
  510.       circumstances where a  high-level protocol has detected what
  511.       it thinks  may  be  an  interface  failure  or hang.    If the
  512.       packet driver  implementer has a high level of confidence in
  513.       the hardware, or the action  would  seriously  disrupt other
  514.       users of the interface, this can be treated as a no-op.
  515.  
  516.  
  517.       4.10    set_rcv_mode()
  518.  
  519.       extended driver function
  520.           set_rcv_mode(handle, mode)      AH == 20
  521.               int      handle;      BX
  522.               int      mode;           CX
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.       PC/TCP Version 1.08 Packet Driver Specification         9
  535.       FTP Software, Inc.
  536.  
  537.  
  538.       error return:
  539.           carry flag set
  540.           error code          DH
  541.           possible errors:
  542.               BAD_HANDLE
  543.               BAD_MODE
  544.  
  545.       non-error return:
  546.           carry flag clear
  547.  
  548.       Sets the  receive  mode  on  the  interface  associated with
  549.       handle. The following values are accepted for mode:
  550.  
  551.       mode        meaning
  552.  
  553.       1        turn off receiver
  554.       2        receive only packets sent to this interface
  555.       3        mode 2 plus broadcast packets
  556.       4        mode 3 plus limited multicast packets
  557.       5        mode 3 plus all multicast packets
  558.       6        all packets
  559.  
  560.       Note that  not all interfaces support all modes. The receive
  561.       mode affects all packets  received  by  this    interface, not
  562.       just packets associated  with  the handle argument.  See the
  563.       extended   driver    functions    get_multicast_list()   and
  564.       set_multicast_list()    for  programming  "perfect filters" to
  565.       receive specific multicast addresses.
  566.  
  567.       Note that mode 3 is the default, and    if  the set_rcv_mode()
  568.       function  is not implemented, mode 3 is  assumed  to    be  in
  569.       force as long  as  any  handles  are    open  (from  the first
  570.       access_type() to the last release_type()).
  571.  
  572.  
  573.       4.11    get_rcv_mode()
  574.  
  575.       extended driver function
  576.           get_rcv_mode(handle, mode)      AH == 21
  577.               int      handle;      BX
  578.  
  579.  
  580.       error return:
  581.           carry flag set
  582.           error code              DH
  583.           possible errors:
  584.               BAD_HANDLE
  585.  
  586.       non-error return:
  587.           carry flag clear
  588.           mode                  AX
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.       10           PC/TCP Version 1.08 Packet Driver Specification
  601.                             FTP Software, Inc.
  602.  
  603.  
  604.       Returns the current receive mode of the interface associated
  605.       with handle.
  606.  
  607.  
  608.       4.12    set_multicast_list()
  609.  
  610.       extended driver function
  611.           set_multicast_list(addrlst, len)      AH == 22
  612.               char far *addrlst;      ES:DI
  613.               int      len;          CX
  614.  
  615.       error return:
  616.           carry flag set
  617.           error code              DH
  618.           possible errors:
  619.               NO_MULTICAST
  620.               NO_SPACE
  621.               BAD_ADDRESS
  622.  
  623.       non-error return:
  624.           carry flag clear
  625.  
  626.       The  addrlst argument is assumed to  point  to  an  len-byte
  627.       buffer  containing   a   number   of     multicast  addresses.
  628.       BAD_ADDRESS is returned if len modulo the size of an address
  629.       is  not equal to 0, or the data  is  unacceptable  for  some
  630.       reason.  NO_SPACE is returned  (and no addresses are set) if
  631.       there   are  more  addresses    than  the  hardware   supports
  632.       directly.
  633.  
  634.       The recommended procedure for setting multicast addresses is
  635.       to issue a get_multicast_list(), copy the  information  to a
  636.       local  buffer,  add  any  addresses  desired,  and  issue  a
  637.       set_multicast_list().    This should be  reversed  when  the
  638.       application exits.  If the set_multicast_list() fails due to
  639.       NO_SPACE, use set_rcv_mode() to set mode 5 instead.
  640.  
  641.  
  642.       4.13    get_multicast_list()
  643.  
  644.       extended driver function
  645.           get_multicast_list()          AH == 23
  646.  
  647.       error return:
  648.           carry flag set
  649.           error code              DH
  650.           possible errors:
  651.               NO_MULTICAST
  652.  
  653.       non-error return:
  654.           carry flag clear
  655.           char far *addrlst;          ES:DI
  656.           int      len;              CX
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.       PC/TCP Version 1.08 Packet Driver Specification        11
  667.       FTP Software, Inc.
  668.  
  669.  
  670.       On  a  successful  return, addrlst points to    len  bytes  of
  671.       multicast addresses  currently  in  use.    The  application
  672.       program must not modify this information in-place.
  673.  
  674.  
  675.       4.14    get_statistics()
  676.  
  677.       extended driver function
  678.           get_statistics(handle)      AH == 24
  679.               int handle;          BX
  680.  
  681.       error return:
  682.           carry flag set
  683.           error code              DH
  684.           possible errors:
  685.               BAD_HANDLE
  686.  
  687.       non-error return:
  688.           carry flag clear
  689.           char far *stats;          DS:SI
  690.  
  691.       statistics structure:
  692.           field                   byte length
  693.           packets in          4
  694.           packets out          4
  695.           bytes in          4
  696.           bytes out          4
  697.           errors in          4
  698.           errors out          4
  699.           packets dropped      4
  700.  
  701.       Returns a pointer to a statistics structure for this handle.
  702.  
  703.  
  704.       4.15    set_address()
  705.  
  706.       extended driver function
  707.           set_address(addr, len)      AH == 25
  708.               char far *addr;      ES:DI
  709.               int len;          CX
  710.  
  711.       error return:
  712.           carry flag set
  713.           error code              DH
  714.           possible errors:
  715.               CANT_SET
  716.               BAD_ADDRESS
  717.  
  718.       non-error return:
  719.           carry flag clear
  720.           length              CX
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.       PC/TCP Version 1.08 Packet Driver Specification         1
  733.       FTP Software, Inc.
  734.  
  735.  
  736.       This call is used when  the  application  or    protocol stack
  737.       needs to use a specific LAN address.     For  instance, DECnet
  738.       protocols on Ethernet encode    the  protocol  address    in the
  739.       Ethernet address, requiring that it be set when the protocol
  740.       stack is loaded.  A  BAD_ADDRESS  error  indicates  that the
  741.       Packet Driver doesn't like the  len (too short or too long),
  742.       or the data  itself.    Note that packet drivers should refuse
  743.       to change the address (with a CANT_SET error)  if  more than
  744.       one handle is  open  (lest  it  be  changed  out  from under
  745.       another protocol stack).
  746.  
  747.  
  748.  
  749.  
  750.  
  751.  
  752.  
  753.  
  754.  
  755.  
  756.  
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.       PC/TCP Version 1.08 Packet Driver Specification       A.1
  799.       FTP Software, Inc.
  800.  
  801.  
  802.  
  803.  
  804.  
  805.  
  806.  
  807.  
  808.                    Appendix A
  809.  
  810.               Interface classes and types
  811.  
  812.  
  813.       The following are defined as network interface classes, with
  814.       their  individual types  listed  immediately    following  the
  815.       class.
  816.  
  817.       DEC/Intel/Xerox "Bluebook" Ethernet
  818.            1
  819.            3COM 3C500/3C501         1
  820.            3COM 3C505        2
  821.            MICOM-Interlan NI5010    3
  822.            BICC Data Networks 4110    4
  823.            BICC Data Networks 4117    5
  824.            MICOM-Interlan NP600    6
  825.            Ungermann-Bass PC-NIC    8
  826.            Univation NC-516         9
  827.            TRW PC-2000        10
  828.            MICOM-Interlan NI5210    11
  829.            3COM 3C503        12
  830.            3COM 3C523        13
  831.            Western Digital WD8003    14
  832.            Spider Systems S4    15
  833.            Torus Frame Level    16
  834.            10NET Communications    17
  835.            Gateway PC-bus        18
  836.            Gateway AT-bus        19
  837.            Gateway MCA-bus        20
  838.            IMC PCnic        21
  839.            IMC PCnic II        22
  840.            IMC PCnic 8bit        23
  841.  
  842.       ProNET-10            2
  843.            Proteon p1300        1
  844.  
  845.       IEEE 802.5/ProNET-4        3
  846.            IBM Token ring adapter    1
  847.            Proteon p1340        2
  848.            Proteon p1344        3
  849.            Gateway PC-bus        4
  850.            Gateway AT-bus        5
  851.            Gateway MCA-bus        6
  852.  
  853.       Omninet            4
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.       A.2           PC/TCP Version 1.08 Packet Driver Specification
  865.                             FTP Software, Inc.
  866.  
  867.  
  868.       Appletalk            5
  869.  
  870.       Serial line            6
  871.  
  872.       Starlan            7    (NOTE: This has been subsumed by
  873.                          Ethernet)
  874.  
  875.       ArcNet            8
  876.            Datapoint RIM        1
  877.  
  878.       AX.25                         9
  879.  
  880.       KISS                10
  881.  
  882.       IEE 802.3 w/802.2 hdrs    11
  883.            Types as given under DIX Ethernet
  884.            See Appendix D.
  885.  
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900.  
  901.  
  902.  
  903.  
  904.  
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.       PC/TCP Version 1.08 Packet Driver Specification       B.1
  931.       FTP Software, Inc.
  932.  
  933.  
  934.  
  935.  
  936.  
  937.  
  938.  
  939.  
  940.                    Appendix B
  941.  
  942.                  Function call numbers
  943.  
  944.  
  945.       The following numbers are used  to  specify  which operation
  946.       the packet driver should  perform.  The  number is stored in
  947.       register AH on call to the packet driver.
  948.  
  949.       driver_info            1
  950.       access_type            2
  951.       release_type            3
  952.       send_pkt            4
  953.       terminate            5
  954.       get_address            6
  955.       reset_interface        7
  956.       *set_rcv_mode                 20
  957.       *get_rcv_mode                 21
  958.       *set_multicast_list        22
  959.       *get_multicast_list        23
  960.       *get_statistics        24
  961.       *set_address            25
  962.  
  963.       * indicates an extended packet driver function
  964.  
  965.  
  966.  
  967.  
  968.  
  969.  
  970.  
  971.  
  972.  
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.       PC/TCP Version 1.08 Packet Driver Specification       C.1
  997.       FTP Software, Inc.
  998.  
  999.  
  1000.  
  1001.  
  1002.  
  1003.  
  1004.  
  1005.  
  1006.                    Appendix C
  1007.  
  1008.                   Error codes
  1009.  
  1010.  
  1011.       Packet driver calls indicate error by setting the carry flag
  1012.       on  return. The error code is returned  in  register    DH  (a
  1013.       register not used to pass values to functions  must  be used
  1014.       to return the error code).  The  following  error  codes are
  1015.       defined:
  1016.  
  1017.       1    BAD_HANDLE        invalid handle number
  1018.  
  1019.       2    NO_CLASS                 no interfaces of specified class found
  1020.  
  1021.       3    NO_TYPE            no interfaces of specified type found
  1022.  
  1023.       4    NO_NUMBER        no interfaces of specified number found
  1024.  
  1025.       5    BAD_TYPE                 bad packet type specified
  1026.  
  1027.       6    NO_MULTICAST        this interface does not support
  1028.                     multicast
  1029.  
  1030.       7    CANT_TERMINATE        this packet driver cannot terminate
  1031.  
  1032.       8    BAD_MODE                 an invalid receiver mode was specified
  1033.  
  1034.       9    NO_SPACE                 operation failed because of insufficient
  1035.                     space
  1036.  
  1037.       10   TYPE_INUSE        the type had previously been accessed,
  1038.                     and not released.
  1039.  
  1040.       11   BAD_COMMAND        the command was out of range, or not
  1041.                     implemented
  1042.  
  1043.       12   CANT_SEND        the packet couldn't be sent (usually
  1044.                     hardware error)
  1045.  
  1046.       13   CANT_SET                 hardware address couldn't be changed
  1047.                     (more than 1 handle open)
  1048.  
  1049.       14   BAD_ADDRESS        hardware address has bad length or
  1050.                     format
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.       PC/TCP Version 1.08 Packet Driver Specification       D.1
  1063.       FTP Software, Inc.
  1064.  
  1065.  
  1066.  
  1067.  
  1068.  
  1069.  
  1070.  
  1071.  
  1072.                    Appendix D
  1073.  
  1074.               802.3 vs. Blue Book Ethernet
  1075.  
  1076.  
  1077.       One weakness of  the    present specification is that there is
  1078.       no provision for simultaneous support of 802.3 and Blue Book
  1079.       (the old DEC-Intel-Xerox standard)  Ethernet    headers  via a
  1080.       single Packet Driver (as defined  by    its  interrupt).   The
  1081.       problem is that the  Ethertype  of  Blue  Book packets is in
  1082.       bytes   12   and   13  of  the  header,  and    in  802.3  the
  1083.       corresponding bytes  are interpreted as a length.  In 802.3,
  1084.       the field which would appear to be most useful to  begin the
  1085.       type    check in is the 802.2 header,  starting  at  byte  14.
  1086.       This    is  only  a  problem  on Ethernet and  variants  (e.g.
  1087.       Starlan), where 802.3  headers  and  Blue  Book  headers are
  1088.       likely to need co-exist for many years to come.
  1089.  
  1090.       One solution is to redefine class 1 as  Blue    Book Ethernet,
  1091.       and  define a parallel class for  802.3  with  802.2    packet
  1092.       headers.  This requires that a 2nd Packet Driver (as defined
  1093.       by its interrupt) be    implemented  where  it is necessary to
  1094.       handle both kinds of    packets,  although  they could both be
  1095.       part of the same TSR module.
  1096.  
  1097.       As of this draft, class 11 has been assigned to  802.3 using
  1098.       802.2 headers, to implement the above.
  1099.  
  1100.       Note: According to this scheme,  an  application  wishing to
  1101.       receive  IP  encapsulated  per  RFC  1042  would  specify an
  1102.       typelen argument of 8, and type would point to:
  1103.  
  1104.           char      iee_ip[] = {0xAA, 0xAA, 3, 0, 0, 0, 0x08, 0x00};
  1105.  
  1106.  
  1107.                     James B. VanBokkelen
  1108.                     jbvb@ftp.com
  1109.                     ...!ftp!jbvb
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.  
  1130.  
  1131.  
  1132.  
  1133.  
  1134.                    Table of Contents
  1135.  
  1136.  
  1137.  
  1138.  
  1139.           1  Introduction and Motivation . . . . . . .  1
  1140.           2  Identifying network interfaces  . . . . .  2
  1141.           3  Initiating driver operations  . . . . . .  3
  1142.           4  Programming interface . . . . . . . . . .  3
  1143.              4.1  Entry conditions . . . . . . . . . .  4
  1144.              4.2  Byte ordering  . . . . . . . . . . .  4
  1145.              4.3  driver_info()  . . . . . . . . . . .  4
  1146.              4.4  access_type()  . . . . . . . . . . .  5
  1147.              4.5  release_type() . . . . . . . . . . .  6
  1148.              4.6  send_pkt() . . . . . . . . . . . . .  7
  1149.              4.7  terminate()  . . . . . . . . . . . .  7
  1150.              4.8  get_address()  . . . . . . . . . . .  7
  1151.              4.9  reset_interface()  . . . . . . . . .  8
  1152.              4.10  set_rcv_mode()  . . . . . . . . . .  8
  1153.              4.11  get_rcv_mode()  . . . . . . . . . .  9
  1154.              4.12  set_multicast_list()  . . . . . . . 10
  1155.              4.13  get_multicast_list()  . . . . . . . 10
  1156.              4.14  get_statistics()  . . . . . . . . . 11
  1157.              4.15  set_address() . . . . . . . . . . . 11
  1158.  
  1159.            Appendix A  Interface classes and types          A-1
  1160.  
  1161.            Appendix B  Function call numbers          B-1
  1162.  
  1163.            Appendix C  Error codes                  C-1
  1164.  
  1165.            Appendix D  802.3 vs. Blue Book Ethernet       D-1
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.                     i
  1188.  
  1189.